import { get, post } from '@/utils/request'

export interface User {
  id: number;
  account: string;
  nickname: string;
  status: number;
  uuid: string;
  sex: number;
  avatar: string;
  age: number;
  email: string;
  phone: string;
  token: string;
  createTime: string; // "2025-11-11 10:31:24"
}

export function loginByPassword(data: { account: string; password: string }) {
  return post<User>('/api/auth/login', data)
}

export function logoutToServer() {
  return post<string>('/api/auth/logout')
}